import {createI18n} from "vue-i18n"
import en from './en'
import zhHans from './zh-Hans'

let locale:string='zh-Hans'
uni.onLocaleChange((e)=>{
    console.log(e);
    
    locale=e.locale?e.locale:''
    uni.reLaunch({
        url:'/pages/index/index',
      })
    
})
const i18n = createI18n({
    locale:locale,
    fallbackLocale:locale,
    globalInjection:true,
    legacy:false,
    messages:{
        en,
        'zh-Hans': zhHans,
    }
})

export default i18n
